home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
A-Monthly Disks
/
(c)aai.d64
/
bowling report
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
6KB
|
211 lines
1 A$="ABCDEFGHIJKLMNOPQ":A$=A$+A$+A$+A$+A$:A$=A$+A$+A$
2 GOTO10000
3 REM **** FIND NEXT LOW RECORD ****
4 NL=NP:NT=NL+1
6 IF LEFT$(W$(NL),12)>LEFT$(W$(NT),12)THENNL=NT
7 IFNT=JTHENRETURN
8 NT=NT+1
9 GOTO6
10 FORZ1=LEN(Z1$)TO1STEP-1:FORZ2=1TO32-LEN(Z1$)+Z1
11 PRINTTAB(Z2)" "MID$(Z1$,Z1,1);"[145]":NEXTZ2:NEXTZ1:RETURN
12 Z3=LEN(Z1$):IFZ3/2<>INT(Z3/2)THENZ1$=" "+Z1$:GOTO12
13 FORZ1=1TOZ3/2:PRINTTAB(19-Z1);LEFT$(Z1$,Z1);RIGHT$(Z1$,Z1):PRINT"[145]";
14 FORZ2=1TO50:NEXTZ2:NEXTZ1:RETURN
30 POKE54296,15:POKE54277,0:POKE54278,247:POKE54276,17:POKE54273,40:POKE54272,0
31 FORZT=1TO100:NEXT:POKE54276,16:POKE54296,4:RETURN
38 PRINT"";:IFR<>0THENPOKE214,R-1:PRINT:REM *** POSITION CURSOR
39 POKE211,C:RETURN
41 GETD$:IFD$=""THEN41
42 RETURN:REM *** GET ROUTINE
43 N%=1:PP$=".":ZZ$="0":GOTO46:REM *** NUMERIC INPUT OF MONEY.
44 N%=1:PP$="":ZZ$="":GOTO46: REM *** NUMERIC INPUT OF QUANTITY.
45 N%=0: REM *** ALPHA-NUMERIC INPUT.
46 GOSUB38:PRINT"";:FORI=1TOL:PRINT" ";:NEXTI:PRINT"[146]";:GOSUB38:DA$="":F%=0
47 FORIJ=1TOL:F%=F%+1
48 GOSUB41
50 IFD$="-"AND DA$=""THEN58
52 IFD$=CHR$(20)ORD$=CHR$(13)THENIJ=L:GOTO60
54 IFN%=1THENIFD$<"0"ORD$>"9"THEN48
56 IFD$<" "ORD$>"Z"THEN48
58 PRINTD$;:DA$=DA$+D$
60 NEXTIJ:IFD$=CHR$(13)THEN66
62 IFD$=CHR$(20)THEN46
63 GOSUB30
64 IFF%=LTHEN68
66 FORIJ=F%TOL:DA$=DA$+" ":NEXT
68 M=VAL(DA$)
70 IFM<0THENNG=1:M=-(M)
71 Y$=STR$(M):LN%=LEN(Y$)
72 IFM<10THENY$=PP$+ZZ$+RIGHT$(Y$,1):GOTO75
73 IFM<100THENY$=PP$+RIGHT$(Y$,2):GOTO75
74 Y$=LEFT$(Y$,LN%-2)+PP$+RIGHT$(Y$,2):IFLEFT$(Y$,1)=" "THENY$=RIGHT$(Y$,LN%)
75 IFLEN(Y$)<L+1THENY$=" "+Y$:GOTO75
76 IFNG=1THENNG=0:M=-(M):Y$=Y$+"-":GOTO79
78 Y$=Y$+" "
79 IFN%=2THEN85
80 GOSUB38:IFN%=1THENPRINT"[157]"Y$;:GOTO85
84 PRINTDA$;
85 RETURN
93 L=9:N%=2:PP$=".":ZZ$="0":GOTO70:REM *** FORMAT MONEY.
94 L=7:N%=2:PP$="":ZZ$="":GOTO70: REM *** FORMAT QUANTITY.
95 PRINT"[147]":SAVE"@0:PROGRAM-NAME",8:END
96 END
100 REM CONVERT RC$ TO RECIPROCAL
110 RC%=LEN(RC$):RC=VAL(RC$)
120 RC=9999-RC:RC$=STR$(RC):RC$=RIGHT$(RC$,RC%):RETURN
150 REM FIND BLANKS NECESSARY TO CENTER A STRING FOR PRINTER
160 CN%=80-LEN(CN$):CN%=INT(CN%/2):RETURN
200 REM PRINT POINT STANDINGS
205 GOSUB2180
210 REM HIGH SERIES/HIGH GAME
220 PRINT#4,BD$:PRINT#4:TY=2:JJ=CT+1
230 GOSUB3000
240 PRINT#4:TY=3:JJ=(CT*2)+CL+CM+1
250 GOSUB3000
260 GOTO2400
1000 REM **** HOUSEKEEPING ******
1010 REM
1020 PRINT"[147]":J=0
1080 C=2:R=10:GOSUB38:PRINT"WHAT IS NAME OF CURRENT FILE....."
1090 R=12:L=16:GOSUB45:DT$=DA$
1100 OPEN 1,8,3,"0:"+DA$
1110 SYS896:O=VAL(LEFT$(A$,4)):DIMU$(O+10),W$(O*3),T(O,2)
1120 FORI=1TOO:SYS896
1125 IFMID$(A$,3,1)="0"THEN1175
1130 IFMID$(A$,21,1)="F"THENCL=CL+1:FD$="1":GOTO1145
1135 CM=CM+1:FD$="2":REM COUNT MEN
1145 RC$=MID$(A$,54,4):RR$=RC$:GOSUB110
1150 J=J+1:W$(J)="2"+FD$+RC$+RR$+LEFT$(A$,2)+MID$(A$,4,17)+LEFT$(BD$,8)
1155 RC$=MID$(A$,46,4):RR$=RC$:GOSUB110
1160 J=J+1:W$(J)="3"+FD$+RC$+RR$+LEFT$(A$,2)+MID$(A$,4,17)+LEFT$(BD$,8)
1162 IFLEFT$(A$,2)="98"THEN1199
1165 U$(I)=LEFT$(A$,20)+MID$(A$,73,4)+MID$(A$,70,3)+MID$(A$,58,6)+MID$(A$,38,4)
1167 T(CT,2)=T(CT,2)+1:CB=CB+1:REM COUNT BOWLERS
1170 GOTO1199
1175 IFLEFT$(A$,2)="99"ORLEFT$(A$,2)="98"THEN1199
1177 CT=CT+1:T(CT,1)=I:HG$=MID$(A$,46,4):HS$=MID$(A$,54,4)
1179 RC$=MID$(A$,28,3):PW$=RC$:GOSUB110
1180 J=J+1:W$(J)="1"+RC$+MID$(A$,31,3)+PW$+LEFT$(A$,2)+MID$(A$,4,17)+HG$+HS$
1181 RC$=HS$:GOSUB110
1182 J=J+1:W$(J)="20"+RC$+HS$+LEFT$(A$,2)+MID$(A$,4,17)+LEFT$(BD$,8)
1183 RC$=HG$:GOSUB110
1184 J=J+1:W$(J)="30"+RC$+HG$+LEFT$(A$,2)+MID$(A$,4,17)+LEFT$(BD$,8)
1186 U$(I)=LEFT$(A$,20)
1199 NEXTI:CLOSE1:BT=INT(CT/2+.5):GOSUB5000
1200 SE$="LEAGUE SECRETARY "
1210 ST$="123-4567"
1220 BN$="** LEAGUE NAME *** - BOWLING LEAGUE"
1230 BD$="==========":BD$=BD$+BD$:BD$=BD$+BD$+BD$+BD$
2000 OPEN4,4:CN$=BN$:GOSUB150
2010 PRINT#4,SPC(CN%);BN$
2020 PRINT"[147]";BN$
2030 R=3:C=4:GOSUB38:PRINT"BOWLING DATE WAS ";DT$
2040 R=5:GOSUB38:PRINT"TYPE IN THE SAME DATE THE WAY YOU ";
2050 PRINT"WOULD LIKE TO SEE IT ON THE REPORT.
2060 R[178]7:L[178]18:[141]45
2070 CN$[178]DA$:[141]150:[152]4,[166]CN%)CN$
2080 [152]4:[152]4,"SECRETARY-";SE$;[166]30);"TELEPHONE # ";ST$
2090 [152]4,BD$:[152]4
2100 [152]4," <POINTS> HIGH HIGH ";
2101 [152]4," <POINTS> HIGH HIGH"
2110 [152]4," S T A N D I N G S WON LOST GAME SER. ";
2111 [152]4," S T A N D I N G S WON LOST GAME SER."
2112 [137]200
2180 [129]JJ[178]1[164]BT: [143] PRINT POINT STANDINGS
2200 W$[178]W$(JJ)
2210 M[178]JJ:[141]94:M$[178][202](Y$,7,2)
2212 LS$[178]M$[170]" "[170][202](W$,13,17)[170]" "[170][202](W$,8,3)[170]" "[170][202](W$,5,3)
2214 LS$[178]LS$[170]" "[170][202](W$,30,4)[170]" "[170][202](W$,34,4)[170]" "
2216 [152]4,LS$;
2222 [139][200](W$(JJ[170]BT),1)[179][177]"1"[167][152]4:JJ[178]BT:[137]2260
2223 W$[178]W$(JJ[170]BT):M[178]JJ[170]BT:[141]94:M$[178][202](Y$,7,2)
2224 RS$[178]M$[170]" "[170][202](W$,13,17)[170]" "[170][202](W$,8,3)[170]" "[170][202](W$,5,3)
2226 RS$[178]RS$[170]" "[170][202](W$,30,4)[170]" "[170][202](W$,34,4)
2228 [152]4,RS$
2260 [130]:[142]
2400 [143] INDIVIDUAL AVERAGES
2410 [152]4,BD$:[152]4
2420 [152]4,[166]24)"===TOTAL=="[166]29)"===TOTAL=="
2430 [152]4," N A M E ======= HDCP GAMES PINS AVG ";
2440 [152]4," N A M E ======= HDCP GAMES PINS AVG"
2490 T%[178]1
2510 LT[178]T(T%,1):LT%[178]T(T%,2)
2520 RT[178]T(T%[170]BT,1):RT%[178]T(T%[170]BT,2)
2530 LS$[178]U$(LT):RS$[178]U$(RT)
2570 RS$[178][202](RS$,4,17)[170]"#"[170][200](RS$,2)[170][200](BL$,20)
2580 LS$[178][202](LS$,4,17)[170]"#"[170][200](LS$,2)[170][200](BL$,20)
2585 [139][200](RS$,2)[178]"98"[167]RT%[178]0:RS$[178][200](BL$,40)
2590 [152]4,LS$;RS$
2600 TT%[178]LT%:[139]RT%[177]LT%[167]TT%[178]RT%
2610 [129]I[178]1[164]TT%
2620 [139]LT%[178]0[167]LS$[178][200](BL$,40):[137]2680
2640 L2$[178]U$(LT[170]I)
2650 LS$[178]" "[170][202](L2$,4,17)[170][202](L2$,22,3)[170]" "[170][202](L2$,25,3)[170]" "
2660 LS$[178]LS$[170][202](L2$,29,5)[170]" "[170][202](L2$,35,3)[170]" "
2670 LT%[178]LT%[171]1
2680 [139]RT%[178]0[167]RS$[178][200](BL$,40):[137]2720
2690 L2$[178]U$(RT[170]I)
2700 RS$[178]" "[170][202](L2$,4,17)[170][202](L2$,22,3)[170]" "[170][202](L2$,25,3)[170]" "
2710 RS$[178]RS$[170][202](L2$,29,5)[170]" "[170][202](L2$,35,3)
2715 RT%[178]RT%[171]1
2720 [152]4,LS$;RS$
2730 [130]
2732 T%[178]T%[170]1
2735 [139]T%[177]BT[167][160]4:[137]4000
2740 [137]2510
3000 [143] PRINT EITHER HIGH SERIES OR HIGH GAME
3150 [139]TY[178]2[167]HD$[178]"H I G H S E R I E S":[137]3170
3160 HD$[178]"H I G H G A M E"
3170 [152]4," ";HD$;" ";HD$;" ";HD$
3180 [152]4," ";[200](BD$,8);"TEAMS";[200](BD$,9);" ";[200](BD$,8);
3190 [152]4,"WOMEN";[200](BD$,9);" ";[200](BD$,9);"MEN";[200](BD$,10)
3200 [129]I[178]JJ[164]JJ[170]2
3205 PP$[178][200](BL$,22):LP$[178]PP$:MP$[178]PP$:RP$[178]PP$
3210 [139]CT[177](I[171]JJ)[167]LP$[178][202](W$(I),13,17)[170]" "[170][202](W$(I),7,4)
3230 [139]CL[177](I[171]JJ)[167]MP$[178][202](W$(I[170]CT),13,17)[170]" "[170][202](W$(I[170]CT),7,4)
3240 [139]CM[177](I[171]JJ)[167]RP$[178][202](W$(I[170]CT[170]CL),13,17)[170]" "[170][202](W$(I[170]CT[170]CL),7,4)
3250 [152]4," ";LP$;" ";MP$;" ";RP$
3260 [130]
3270 I[178]2
3271 W1$[178]W$(JJ[170]2)
3272 W2$[178]W$(JJ[170]I[170]1)
3273 W3$[178]W$(JJ[170]2[170]CT)
3274 W4$[178]W$(JJ[170]I[170]CT[170]1)
3275 W5$[178]W$(JJ[170]2[170]CT[170]CL)
3276 W6$[178]W$(JJ[170]I[170]CT[170]CL[170]1)
3280 [139][202](W2$,2,1)[178]"0"[175][202](W2$,7,4)[178][202](W1$,7,4)[167]3400
3282 LP$[178]PP$
3284 [139][202](W4$,2,1)[178]"1"[175][202](W4$,7,4)[178][202](W3$,7,4)[167]3410
3286 MP$[178]PP$
3288 [139][202](W6$,2,1)[178]"2"[175][202](W6$,7,4)[178][202](W5$,7,4)[167]3420
3290 RP$[178]PP$
3300 [139] T1$[179][177]"Y"[167][142]
3310 [152]4," ";LP$;" ";MP$;" ";RP$
3320 T1$[178]"N":I[178]I[170]1:[137]3271
3400 LP$[178][202](W2$,13,17)[170]" "[170][202](W2$,7,4):T1$[178]"Y":[137]3284
3410 MP$[178][202](W4$,13,17)[170]" "[170][202](W4$,7,4):T1$[178]"Y":[137]3288
3420 RP$[178][202](W6$,13,17)[170]" "[170][202](W6$,7,4):T1$[178]"Y":[137]3300
4000 [153]"LOADALIGN PAPER & PRINT AGAIN (Y/N)";
4010 [133]XX$
4020 [139]XX$[178]"Y"[167]1200
4030 [139]XX$[178]"N"[167][128]
4040 [137]4000
5000 [143] **** SORT ROUTINE ****
5010 [153]"LOAD";:[153]"SORTING"J" RECORDS"
5020 NP[178]1:SC[178]1
5030 [153]SC:SC[178]SC[170]1
5040 [141]3
5050 TH$[178]W$(NP)
5060 W$(NP)[178]W$(NL)
5070 W$(NL)[178]TH$
5080 NP[178]NP[170]1
5090 [139]NP[178]J[167][142]
5100 [137]5030
10000 [129]J[178]896[164]933:[135]X:[151]J,X:[130]J
10020 [131]160,002,177,045,153,137,000,200,192,006
10030 [131]208,246,162,001,032,198,255
10040 [131]032,228,255,201,013,240,011,164,142,145
10050 [131]140,200,132,142,196,139,208,238,076,204,255
10055 BL$[178]" "
11060 [137]1000